<div class="col-lg-12 dashboard">
    <h4>Dashboard</h4>
    <div class="row">
        <!-- easypiechart -->
        <div class="col-sm-4">
            <section class="panel text-center">
                <div class="panel-body">
                    <a class="btn btn-circle btn-info btn-lg"><i class="fa fa-users"></i></a>
                    <div class="h4">Visits</div>
                    <div class="line m-l m-r"></div>
                    <h3 class="text-info"><strong>{{$data['visits']}}</strong></h3>
                    <small>Last 30 days</small>
                </div>
            </section>
        </div>
        <div class="col-sm-4">
            <section class="panel text-center">
                <div class="panel-body">
                    <a class="btn btn-circle btn-info btn-lg"><i class="fa fa-eye"></i></a>
                    <div class="h4">Pageviews</div>
                    <div class="line m-l m-r"></div>
                    <h3 class="text-info"><strong>{{$data['pageviews']}}</strong></h3>
                    <small>Last 30 days</small>
                </div>
            </section>
        </div>
        <div class="col-sm-4">
            <section class="panel text-center">
                <div class="panel-body">
                    <a class="btn btn-circle btn-info btn-lg"><i class="fa fa-clock-o"></i></a>
                    <div class="h4">Avg. Session Duration (min)</div>
                    <div class="line m-l m-r"></div>
                    <h3 class="text-info"><strong>{{$english_format_number = number_format($data['timeonsite'], 2, ',', '');}}</strong></h3>
                    <small>Last 30 days</small>
                </div>
            </section>
        </div>
        <!-- easypiechart end-->
    </div>
    <div class="row">
        <div class="col-lg-6">
            <section class="panel">
                <header class="panel-heading">Referrer</header>
                <div class="table-responsive">
                    <table class="table table-striped m-b-none" data-ride="datatables">
                        <thead>
                            <tr>
                                <th width="70">Site</th>
                                <th>Visits</th>                    
                                <th>Pageviews</th>
                            </tr>
                        </thead>
                        <tbody>
        	                @foreach($data['sources'] as $source => $dataSource)
                                <tr>                    
                                    <td>{{$source}}</td>
                                    <td>{{$dataSource['visits']}}</td>
                                    <td>{{$dataSource['pageviews']}}</td>
                                </tr>
                            @endforeach
                        </tbody>
                    </table>
                </div>
            </section>
        </div>
        <div class="col-lg-6">
            <section class="panel">
                <header class="panel-heading">Keywords</header>
                <div class="table-responsive">
                    <table class="table table-striped m-b-none" data-ride="datatables">
                        <thead>
                            <tr>
                                <th width="100">Keyword</th>
                            </tr>
                        </thead>
                        <tbody>
        	                @foreach($data['keywords'] as $key => $keyword)
                                <tr>                    
                                    <td>{{$keyword}}</td>
                                </tr>
                            @endforeach
                        </tbody>
                    </table>
                </div>
            </section>
        </div>
    </div>
</div>
@section('extra-javascript')
{{ HTML::script('js/datatables/jquery.dataTables.min.js')}}
<script>
// datatable
$('[data-ride="datatables"]').each(function() {
	var oTable = $(this).dataTable( {
		"sDom": "<'row'<'col-sm-6'l><'col-sm-6'f>r>t<'row'<'col-sm-6'i><'col col-sm-6'p>>",
		"sPaginationType": "full_numbers"
	} );
});
</script>
@stop
